<link rel="stylesheet" href="css/jquery.jqplot.min.css" />
<?php echo module_open(); ?>
<?php
if ($page_list)
{
?>
<tr class="show1200">
    <td class="head" colspan="9">
        Tùy chọn xem
    </td>
</tr>
<tr class="show1200">
    <td class="fr page" colspan="9">
        <?php echo $page_list ?>
    </td>
</tr>
<?php
}
?>
<tr>
    <td class="head center" width="1%"><input type="checkbox" class="checkAll" /></td>
    <td class="head" width="3%" align="center"><b>#</b></td>
    <td class="head" width="8%"><b>IP</b></td>
    <td class="head" width="8%"><span class="hide480"><b>Thời gian</b></span></td>
    <td class="head hide980" width="8%"><b>Trình duyệt</b></td>
    <td class="head hide480" width="15%"><b>Vị trí</b></td>
    <td class="head hide1200" width="15%"><b>Quốc gia</b></td>
    <td class="head hide640" width="8%"><b>Nguồn</b></td>
    <td class="head" width="1%"><b>&nbsp;</b></td>
</tr>
<?php
if(count($online) && is_array($online))
{
    $i = 1;
    foreach ($online as $row)
    {
        $country = get_data('countries', "code = '$row[country]'", 'country');
?>
<tr class="highlight<?php echo ($row['isnew'] ? ' table-flag-red' : '') ?>" id="<?php echo $row['id'] ?>" name="<?php echo $row['online_ip'] ?>">
    <td class="fr center"><?php echo sel_item($row['id']) ?></td>
    <td class="fr center"><?php echo stt($row['id'], $GLOBALS['var']['rowstart'] + $i++) ?></td>
    <td class="fr"><?php echo $row['online_ip'] ?></td>
    <td class="fr"><?php echo strftime(TIME_STR, strtotime($row['date_added'])) ?></td>
    <td class="fr hide980"><?php echo $row['trinhduyet'] ?></td>
    <td class="fr hide480"><?php echo ($row['city'] ? $row['city'] : 'unknown') ?></td>
    <td class="fr hide1200"><?php echo ($country ? $country : 'unknown') ?></td>
    <td class="fr hide640">
        <?php echo ($row['referer'] ? '<a href="'.$row['referer'].'" target="_blank">' : '') ?>
        <?php echo ($row['backlink'] ? $row['backlink'] : '<em>direct/none</em>') ?>
        <?php echo ($row['referer'] ? '</a>' : '') ?>
    </td>
    <td class="fr"><?php if ($GLOBALS['per']['del']) echo remove_link($row['id']) ?></td>
</tr>
<?php
    }
}
else
{
    echo no_data_mes(9);
}
echo module_close();
?>